package com.flashmoment.video.service.impl;

import com.flashmoment.video.entity.UserEntity;
import com.flashmoment.video.utils.PageUtils;
import com.flashmoment.video.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.flashmoment.video.dao.UserConcernsDao;
import com.flashmoment.video.entity.UserConcernsEntity;
import com.flashmoment.video.service.UserConcernsService;


@Service("userConcernsService")
public class UserConcernsServiceImpl extends ServiceImpl<UserConcernsDao, UserConcernsEntity> implements UserConcernsService {

    @Autowired
    private UserConcernsDao userConcernsDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<UserConcernsEntity> page = this.page(
                new Query<UserConcernsEntity>().getPage(params),
                new QueryWrapper<UserConcernsEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<UserEntity> findMyConcernByUserId(Integer id) {
        return userConcernsDao.findMyConcernByUserId(id);
    }

}